#include<iostream>
using namespace std;
int main(){
    int x,y;
    while(cin>>x>>y&&-39<=x<=50&&-39<=y<=50&&y>=x){
        if(x==0&&y==0) break;
        int sum,num=0;
        for (int i=x;i<=y;i++){
            sum=i*i+i+41;
            for(int j=2;j<sum;j++){
                if(sum%j==0)num++;
            }
        }
         if(num==0)
            cout<<"OK"<<endl;
        else cout<<"Sorry"<<endl;
    }

}